
#include <cusp/detail/config.h>
#include <cusp/gallery/stencil.h>

template <typename MatrixType>
void full_weighting_2D( MatrixType & matrix, size_t dim_size){
  typedef typename MatrixType::index_type IndexType;
  typedef typename MatrixType::value_type ValueType; 
  typedef thrust::tuple<IndexType,IndexType>    StencilIndex;
  typedef thrust::tuple<StencilIndex,ValueType> StencilPoint;
  cusp::array1d<StencilPoint, cusp::host_memory> stencil;
  stencil.push_back(StencilPoint(StencilIndex( 0, 0), 1));

  stencil.push_back(StencilPoint(StencilIndex( 0, -1), 0.5));
  stencil.push_back(StencilPoint(StencilIndex( 0, 1), 0.5));
  stencil.push_back(StencilPoint(StencilIndex( -1, 0), 0.5));
  stencil.push_back(StencilPoint(StencilIndex( 1, 0), 0.5));

  stencil.push_back(StencilPoint(StencilIndex( 1, -1), 0.25));
  stencil.push_back(StencilPoint(StencilIndex( 1, 1), 0.25));
  stencil.push_back(StencilPoint(StencilIndex( -1, 1), 0.25));
  stencil.push_back(StencilPoint(StencilIndex( -1, -1), 0.25));

  
  cusp::gallery::generate_matrix_from_stencil(matrix, stencil, StencilIndex((dim_size+1)/2-1,dim_size));


}; 
